<template>
  <div class="radioPillGroup">
    <span
      v-for="(item,index) of radioPillList"
      class="radioPill"
      :class="{radioPillActive:currentIndex==index}"
      :key="item.key"
      @click="radioPillHandle(index)"
    >{{item.txt}}</span>
  </div>
</template>

<script>
  export default {
    name: 'moduleRadioPill',
    props: {
      radioPillList: {
        type: Array
      }
    },
    data () {
      return {
        currentIndex: 0
      }
    },
    methods: {
      radioPillHandle (data) {
        this.currentIndex = data
      }
    }
  }
</script>
